package DSENS;

/**
 *
 * @author Filippo,teeteto
 */
import java.util.ArrayList;

public class EventManager {


    public EventManager(){
    }

    public boolean execEvent(ArrayList<Node> network) {
        
        Event event = GlobalInfo.TIMELINE.getEvent();
        if(event != null) {
            network.get(event.getrcvNodeID()).run(event);
            return true;
        }
        else {
            System.out.println("End simulation.");
            return false;
        }
    }

    public boolean execEvent(TimeLine tl, ArrayList<Node> network) {

        Event event = tl.getEvent();
        if(event != null) {
            network.get(event.getrcvNodeID()).run(event);
            return true;
        }
        else {
            System.out.println("End simulation.");
            return false;
        }
    }

}

